package com.ligy.utils;

import javax.swing.*;
import java.awt.*;

public class JFrameUtils {
    public static JLabel loadJLabelImage(java.awt.Container container, String imaPath, int x, int y, int width, int height) {
        JLabel imageContainer = new JLabel(new ImageIcon(imaPath));
        imageContainer.setBounds(x, y, width, height);
        container.add(imageContainer);

        return imageContainer;
    }

    public static JTextField createInput(Container container, int x, int y, int width, int height) {
        JTextField input = new JTextField();
        input.setBounds(x, y, width, height);
        container.add(input);
        return input;
    }

    public static JPasswordField createPassInput(Container container, int x, int y, int width, int height) {
        JPasswordField input = new JPasswordField();
        input.setBounds(x, y, width, height);
        container.add(input);
        return input;
    }

    public static JLabel createText(Container container, String text, int x, int y, int width, int height) {
        JLabel label = new JLabel(text);
        label.setBounds(x, y, width, height);
        container.add(label);
        return label;
    }
}
